#ifndef SCRIPTEDITOR_H
#define SCRIPTEDITOR_H

#include <QtGui/QDialog>
#include "LitScriptPrereqs.h"
#include "ui_ScriptEditor.h"
#include <LitEditorInstance.h>

namespace Lit
{
	namespace Editor
	{
		class ScriptEditor : public QMainWindow, public RenderWidgetListener
		{
			Q_OBJECT
				RefPtr<Instance> mInstance;
		public:
			ScriptEditor(QWidget *parent = 0, Qt::WFlags flags = 0);
			~ScriptEditor();
			
			bool frameStarted( const Ogre::FrameEvent &evt );

			void closeEvent( QCloseEvent * evt );
			
			void updateUi();

		protected slots:
			void createScene();
			
			void on_actionNew_Solution_triggered();
			void on_actionOpen_Solution_triggered();
			void on_actionSave_Solution_triggered();
			void on_actionSave_Solution_As_triggered();
			void on_actionClose_Solution_triggered();

			void on_actionNew_Script_triggered();
			void on_actionOpen_Script_triggered();
			void on_actionSave_Script_triggered();
			void on_actionSave_Script_As_triggered();
			void on_actionClose_Script_triggered();
			void on_actionExit_triggered();
			
			void on_actionCompile_triggered();
			void on_actionCompile_Run_triggered();
			void on_actionCompile_ByteCode_triggered();
			void on_actionVariables_triggered();
			void on_actionProperties_triggered();

		private:
			Ui::ScriptEditorClass		ui;
			ScriptSolutionPtr			mSolution;
			ScriptRegistersPtr			mVariables;
		};
	};
};

#endif // SCRIPTEDITOR_H
